package com.yuantong.xyerp.core.provider.service;

import com.yuantong.xyerp.core.api.dto.RoleDto;
import com.yuantong.xyerp.core.api.dto.UserDto;
import com.yuantong.xyerp.core.api.model.Role;
import com.yuantong.xyerp.core.api.service.IRoleService;
import com.yuantong.xyerp.core.provider.dao.RoleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by Jianguo.Yin on 2021-07-09.
 */
@Service
public class RoleServiceImpl implements IRoleService {

    @Resource
    private RoleMapper roleMapper;

    @Override
    public RoleDto findRoleByUser(UserDto userDto) {
        return roleMapper.findRoleByUser(userDto);
    }

    @Override
    public int addRole(RoleDto roleDto) {
        return roleMapper.addRole(roleDto);
    }

    @Override
    public Role findRoleByName(RoleDto roleDto) {
        return roleMapper.findRoleByName(roleDto);
    }

    @Override
    public int delete(RoleDto roleDto) {
        return roleMapper.delete(roleDto);
    }

}
